package com.zhiyou100.util;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class DateUtil {
	public static String getTime(Integer stime) {
		int shour = stime/3600;
		int sminute = (stime - shour*3600)/60;
		int ssecond = stime-shour*3600-sminute*60;
		String hour="";
		String minute="";
		String second = "";
		if(shour<10) {
			hour = "0"+shour;
		}else {
			hour = String.valueOf(shour);
		}
		if(sminute<10) {
			minute = "0"+sminute;
		}else {
			minute = String.valueOf(sminute);
		}
		if(ssecond<10) {
			second = "0"+ssecond;
		}else {
			second = String.valueOf(ssecond);
		}
		String time = hour+":"+minute+":"+second;
		return time;
	}
	public static Integer setTime(String stime) {
		String[] str = stime.split("\\:");
		Integer count = 0;
		Integer c = 3600;
		for (String string : str) {
			count = count + Integer.parseInt(string)*c;
			c = c /60;
		}
		return count;
	}
}
